<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$merchid=$this->checklogin();
$merch=pdo_get('jy_merch_user',array('id'=>$merchid,'uniacid'=>$_SESSION['uniacid']));
$return['plugin_icon']=$merch['logo'];
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('merchset'.$merchid,$postdata);
		exi('设置成功');
	}
    $footernav =array(
        array('title'=>'首页','icon'=>'icon-dianpu','action'=>'jy_merchfuwu/merchshop//merchid='.$merchid),
        array('title'=>'我的','icon'=>'icon-wo1','action'=>'jy_merchfuwu/member.index/'),
    );
	$indexcube =array(
		array('title'=>'首页','image'=>'../addons/jy_weishop/resource/images/mobile-hdp02.jpg','action'=>'jy_merchfuwu/merchshop/'),
	);
	$merchhdps =array(
		array('title'=>'首页','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp01.jpg','action'=>'jy_merchfuwu/merchshop/'),
		array('title'=>'全部','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp02.jpg','action'=>'jy_merchfuwu/merchshop/'),
	);
	$return['item']=$this->plugin_setting('merchset'.$merchid);
	$return['item']['indexcube']=$return['item']['indexcube']?$return['item']['indexcube']:$indexcube;
	$return['item']['merchhdps']=$return['item']['merchhdps']?$return['item']['merchhdps']:$merchhdps;
    $return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					array('type'=>'image','title'=>'网站二维码','name'=>'ewm'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
				'title'=>'幻灯片',
					'list'=>array(
						array(
							'type'=>'array',
							'name'=>'merchhdps',
							'add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片'),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片','help'=>''),
									array('type'=>'link','name'=>'url','from'=>'action','title'=>'幻灯片链接'),
									
								)
						)
					)
			),		
			array(
					'title'=>'首页插图',
					'list'=>array(
						array('type'=>'array','name'=>'indexcube','add_tip'=>'添加一个插图',
								'list'=>array(
									array('type'=>'image','name'=>'image','title'=>'图片'),	
									array('type'=>'string','name'=>'url','title'=>'链接'),
								),
								'details'=>array(
									array('type'=>'image','name'=>'image','title'=>'图片'),
									array('type'=>'link','name'=>'url','from'=>'action','title'=>'链接'),
								)
						),
					)
			),
            array(
                'title'=>'商户商城底部导航',
                array('type'=>'string','title'=>'底部导航','name'=>'feeurl'),
                'list'=>array(
                    array('type'=>'tip','title'=>'<red>底部导航优先显示商户分组--底部导航的设置</red>'),
                    array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
                        'list'=>array(
                            array('type'=>'string','name'=>'title','title'=>'导航名称'),
                            array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
                            array('type'=>'string','name'=>'action','title'=>'导航链接'),
                        ),
                        'details'=>array(
                            array('type'=>'string','name'=>'title','title'=>'导航名称'),
                            array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),
                            array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
                        )
                    ),
                )
            ),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
